const IP_ADDRESS = "ipAddress"
export const checkIp = () => {
  if (!localStorage.getItem(IP_ADDRESS)) {
    const url = 'https://ip-api.io/json';
    fetch(url)
      .then(response => response.json())
      .then(data => {
        localStorage.setItem(IP_ADDRESS, data.ip)
      });
  }
}

export const getIpAddress = () => {
  return localStorage.getItem(IP_ADDRESS)
}
